3.31 \(\int \frac{A+B x+C x^2}{\sqrt{a+b x} \sqrt{a c-b c x} (e+f x)} \, dx\)

Optimal. Leaf size=278 \[ \frac{\sqrt{a^2 c-b^2 c x^2} \left (A f^2-B e f+C e^2\right ) \tan ^{-1}\left (\frac{\sqrt{c} \left (a^2 f+b^2 e x\right )}{\sqrt{a^2 c-b^2 c x^2} \sqrt{b^2 e^2-a^2 f^2}}\right )}{\sqrt{c} f^2 \sqrt{a+b x} \sqrt{a c-b c x} \sqrt{b^2 e^2-a^2 f^2}}-\frac{\sqrt{a^2 c-b^2 c x^2} (C e-B f) \tan ^{-1}\left (\frac{b \sqrt{c} x}{\sqrt{a^2 c-b^2 c x^2}}\right )}{b \sqrt{c} f^2 \sqrt{a+b x} \sqrt{a c-b c x}}-\frac{C \left (a^2-b^2 x^2\right )}{b^2 f \sqrt{a+b x} \sqrt{a c-b c x}} \]

[Out]

-((C*(a^2 - b^2*x^2))/(b^2*f*Sqrt[a + b*x]*Sqrt[a*c - b*c*x])) - ((C*e - B*f)*Sqrt[a^2*c - b^2*c*x^2]*ArcTan[(
b*Sqrt[c]*x)/Sqrt[a^2*c - b^2*c*x^2]])/(b*Sqrt[c]*f^2*Sqrt[a + b*x]*Sqrt[a*c - b*c*x]) + ((C*e^2 - B*e*f + A*f
^2)*Sqrt[a^2*c - b^2*c*x^2]*ArcTan[(Sqrt[c]*(a^2*f + b^2*e*x))/(Sqrt[b^2*e^2 - a^2*f^2]*Sqrt[a^2*c - b^2*c*x^2
])])/(Sqrt[c]*f^2*Sqrt[b^2*e^2 - a^2*f^2]*Sqrt[a + b*x]*Sqrt[a*c - b*c*x])

________________________________________________________________________________________

Rubi [A]  time = 0.464124, antiderivative size = 278, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 7, integrand size = 40, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.175, Rules used = {1610, 1654, 844, 217, 203, 725, 204} \[ \frac{\sqrt{a^2 c-b^2 c x^2} \left (A f^2-B e f+C e^2\right ) \tan ^{-1}\left (\frac{\sqrt{c} \left (a^2 f+b^2 e x\right )}{\sqrt{a^2 c-b^2 c x^2} \sqrt{b^2 e^2-a^2 f^2}}\right )}{\sqrt{c} f^2 \sqrt{a+b x} \sqrt{a c-b c x} \sqrt{b^2 e^2-a^2 f^2}}-\frac{\sqrt{a^2 c-b^2 c x^2} (C e-B f) \tan ^{-1}\left (\frac{b \sqrt{c} x}{\sqrt{a^2 c-b^2 c x^2}}\right )}{b \sqrt{c} f^2 \sqrt{a+b x} \sqrt{a c-b c x}}-\frac{C \left (a^2-b^2 x^2\right )}{b^2 f \sqrt{a+b x} \sqrt{a c-b c x}} \]

Antiderivative was successfully verified.

[In]

Int[(A + B*x + C*x^2)/(Sqrt[a + b*x]*Sqrt[a*c - b*c*x]*(e + f*x)),x]

[Out]

-((C*(a^2 - b^2*x^2))/(b^2*f*Sqrt[a + b*x]*Sqrt[a*c - b*c*x])) - ((C*e - B*f)*Sqrt[a^2*c - b^2*c*x^2]*ArcTan[(
b*Sqrt[c]*x)/Sqrt[a^2*c - b^2*c*x^2]])/(b*Sqrt[c]*f^2*Sqrt[a + b*x]*Sqrt[a*c - b*c*x]) + ((C*e^2 - B*e*f + A*f
^2)*Sqrt[a^2*c - b^2*c*x^2]*ArcTan[(Sqrt[c]*(a^2*f + b^2*e*x))/(Sqrt[b^2*e^2 - a^2*f^2]*Sqrt[a^2*c - b^2*c*x^2
])])/(Sqrt[c]*f^2*Sqrt[b^2*e^2 - a^2*f^2]*Sqrt[a + b*x]*Sqrt[a*c - b*c*x])

Rule 1610

Int[(Px_)*((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Dist[((
a + b*x)^FracPart[m]*(c + d*x)^FracPart[m])/(a*c + b*d*x^2)^FracPart[m], Int[Px*(a*c + b*d*x^2)^m*(e + f*x)^p,
 x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && PolyQ[Px, x] && EqQ[b*c + a*d, 0] && EqQ[m, n] &&  !Intege
rQ[m]

Rule 1654

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Expon[Pq, x], f = Coeff
[Pq, x, Expon[Pq, x]]}, Simp[(f*(d + e*x)^(m + q - 1)*(a + c*x^2)^(p + 1))/(c*e^(q - 1)*(m + q + 2*p + 1)), x]
 + Dist[1/(c*e^q*(m + q + 2*p + 1)), Int[(d + e*x)^m*(a + c*x^2)^p*ExpandToSum[c*e^q*(m + q + 2*p + 1)*Pq - c*
f*(m + q + 2*p + 1)*(d + e*x)^q - f*(d + e*x)^(q - 2)*(a*e^2*(m + q - 1) - c*d^2*(m + q + 2*p + 1) - 2*c*d*e*(
m + q + p)*x), x], x], x] /; GtQ[q, 1] && NeQ[m + q + 2*p + 1, 0]] /; FreeQ[{a, c, d, e, m, p}, x] && PolyQ[Pq
, x] && NeQ[c*d^2 + a*e^2, 0] &&  !(EqQ[d, 0] && True) &&  !(IGtQ[m, 0] && RationalQ[a, c, d, e] && (IntegerQ[
p] || ILtQ[p + 1/2, 0]))

Rule 844

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dist[g/e, Int[(d
+ e*x)^(m + 1)*(a + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + c*x^2)^p, x], x] /; FreeQ[{a,
c, d, e, f, g, m, p}, x] && NeQ[c*d^2 + a*e^2, 0] &&  !IGtQ[m, 0]

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 725

Int[1/(((d_) + (e_.)*(x_))*Sqrt[(a_) + (c_.)*(x_)^2]), x_Symbol] :> -Subst[Int[1/(c*d^2 + a*e^2 - x^2), x], x,
 (a*e - c*d*x)/Sqrt[a + c*x^2]] /; FreeQ[{a, c, d, e}, x]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{A+B x+C x^2}{\sqrt{a+b x} \sqrt{a c-b c x} (e+f x)} \, dx &=\frac{\sqrt{a^2 c-b^2 c x^2} \int \frac{A+B x+C x^2}{(e+f x) \sqrt{a^2 c-b^2 c x^2}} \, dx}{\sqrt{a+b x} \sqrt{a c-b c x}}\\ &=-\frac{C \left (a^2-b^2 x^2\right )}{b^2 f \sqrt{a+b x} \sqrt{a c-b c x}}-\frac{\sqrt{a^2 c-b^2 c x^2} \int \frac{-A b^2 c f^2+b^2 c f (C e-B f) x}{(e+f x) \sqrt{a^2 c-b^2 c x^2}} \, dx}{b^2 c f^2 \sqrt{a+b x} \sqrt{a c-b c x}}\\ &=-\frac{C \left (a^2-b^2 x^2\right )}{b^2 f \sqrt{a+b x} \sqrt{a c-b c x}}-\frac{\left ((C e-B f) \sqrt{a^2 c-b^2 c x^2}\right ) \int \frac{1}{\sqrt{a^2 c-b^2 c x^2}} \, dx}{f^2 \sqrt{a+b x} \sqrt{a c-b c x}}+\frac{\left (\left (C e^2-B e f+A f^2\right ) \sqrt{a^2 c-b^2 c x^2}\right ) \int \frac{1}{(e+f x) \sqrt{a^2 c-b^2 c x^2}} \, dx}{f^2 \sqrt{a+b x} \sqrt{a c-b c x}}\\ &=-\frac{C \left (a^2-b^2 x^2\right )}{b^2 f \sqrt{a+b x} \sqrt{a c-b c x}}-\frac{\left ((C e-B f) \sqrt{a^2 c-b^2 c x^2}\right ) \operatorname{Subst}\left (\int \frac{1}{1+b^2 c x^2} \, dx,x,\frac{x}{\sqrt{a^2 c-b^2 c x^2}}\right )}{f^2 \sqrt{a+b x} \sqrt{a c-b c x}}-\frac{\left (\left (C e^2-B e f+A f^2\right ) \sqrt{a^2 c-b^2 c x^2}\right ) \operatorname{Subst}\left (\int \frac{1}{-b^2 c e^2+a^2 c f^2-x^2} \, dx,x,\frac{a^2 c f+b^2 c e x}{\sqrt{a^2 c-b^2 c x^2}}\right )}{f^2 \sqrt{a+b x} \sqrt{a c-b c x}}\\ &=-\frac{C \left (a^2-b^2 x^2\right )}{b^2 f \sqrt{a+b x} \sqrt{a c-b c x}}-\frac{(C e-B f) \sqrt{a^2 c-b^2 c x^2} \tan ^{-1}\left (\frac{b \sqrt{c} x}{\sqrt{a^2 c-b^2 c x^2}}\right )}{b \sqrt{c} f^2 \sqrt{a+b x} \sqrt{a c-b c x}}+\frac{\left (C e^2-B e f+A f^2\right ) \sqrt{a^2 c-b^2 c x^2} \tan ^{-1}\left (\frac{\sqrt{c} \left (a^2 f+b^2 e x\right )}{\sqrt{b^2 e^2-a^2 f^2} \sqrt{a^2 c-b^2 c x^2}}\right )}{\sqrt{c} f^2 \sqrt{b^2 e^2-a^2 f^2} \sqrt{a+b x} \sqrt{a c-b c x}}\\ \end{align*}

Mathematica [A]  time = 0.729006, size = 225, normalized size = 0.81 \[ \frac{\sqrt{a-b x} \left (\frac{2 \left (f (A f-B e)+C e^2\right ) \tan ^{-1}\left (\frac{\sqrt{a-b x} \sqrt{a f-b e}}{\sqrt{a+b x} \sqrt{-a f-b e}}\right )}{\sqrt{-a f-b e} \sqrt{a f-b e}}+\frac{2 \tan ^{-1}\left (\frac{\sqrt{a-b x}}{\sqrt{a+b x}}\right ) (a C f-b B f+b C e)}{b^2}+\frac{C f \sqrt{a+b x} \left (-\sqrt{a-b x}-\frac{2 \sqrt{a} \sin ^{-1}\left (\frac{\sqrt{a-b x}}{\sqrt{2} \sqrt{a}}\right )}{\sqrt{\frac{b x}{a}+1}}\right )}{b^2}\right )}{f^2 \sqrt{c (a-b x)}} \]

Antiderivative was successfully verified.

[In]

Integrate[(A + B*x + C*x^2)/(Sqrt[a + b*x]*Sqrt[a*c - b*c*x]*(e + f*x)),x]

[Out]

(Sqrt[a - b*x]*((C*f*Sqrt[a + b*x]*(-Sqrt[a - b*x] - (2*Sqrt[a]*ArcSin[Sqrt[a - b*x]/(Sqrt[2]*Sqrt[a])])/Sqrt[
1 + (b*x)/a]))/b^2 + (2*(b*C*e - b*B*f + a*C*f)*ArcTan[Sqrt[a - b*x]/Sqrt[a + b*x]])/b^2 + (2*(C*e^2 + f*(-(B*
e) + A*f))*ArcTan[(Sqrt[-(b*e) + a*f]*Sqrt[a - b*x])/(Sqrt[-(b*e) - a*f]*Sqrt[a + b*x])])/(Sqrt[-(b*e) - a*f]*
Sqrt[-(b*e) + a*f])))/(f^2*Sqrt[c*(a - b*x)])

________________________________________________________________________________________

Maple [B]  time = 0., size = 503, normalized size = 1.8 \begin{align*}{\frac{1}{{b}^{2}{f}^{3}c} \left ( -A\ln \left ( 2\,{\frac{1}{fx+e} \left ({b}^{2}cex+{a}^{2}cf+\sqrt{{\frac{c \left ({a}^{2}{f}^{2}-{b}^{2}{e}^{2} \right ) }{{f}^{2}}}}\sqrt{-c \left ({b}^{2}{x}^{2}-{a}^{2} \right ) }f \right ) } \right ){b}^{2}c{f}^{2}\sqrt{{b}^{2}c}+B\ln \left ( 2\,{\frac{1}{fx+e} \left ({b}^{2}cex+{a}^{2}cf+\sqrt{{\frac{c \left ({a}^{2}{f}^{2}-{b}^{2}{e}^{2} \right ) }{{f}^{2}}}}\sqrt{-c \left ({b}^{2}{x}^{2}-{a}^{2} \right ) }f \right ) } \right ){b}^{2}cef\sqrt{{b}^{2}c}+B\arctan \left ({x\sqrt{{b}^{2}c}{\frac{1}{\sqrt{-c \left ({b}^{2}{x}^{2}-{a}^{2} \right ) }}}} \right ){b}^{2}c{f}^{2}\sqrt{{\frac{c \left ({a}^{2}{f}^{2}-{b}^{2}{e}^{2} \right ) }{{f}^{2}}}}-C\ln \left ( 2\,{\frac{1}{fx+e} \left ({b}^{2}cex+{a}^{2}cf+\sqrt{{\frac{c \left ({a}^{2}{f}^{2}-{b}^{2}{e}^{2} \right ) }{{f}^{2}}}}\sqrt{-c \left ({b}^{2}{x}^{2}-{a}^{2} \right ) }f \right ) } \right ){b}^{2}c{e}^{2}\sqrt{{b}^{2}c}-C\arctan \left ({x\sqrt{{b}^{2}c}{\frac{1}{\sqrt{-c \left ({b}^{2}{x}^{2}-{a}^{2} \right ) }}}} \right ){b}^{2}cef\sqrt{{\frac{c \left ({a}^{2}{f}^{2}-{b}^{2}{e}^{2} \right ) }{{f}^{2}}}}-C{f}^{2}\sqrt{{b}^{2}c}\sqrt{{\frac{c \left ({a}^{2}{f}^{2}-{b}^{2}{e}^{2} \right ) }{{f}^{2}}}}\sqrt{-c \left ({b}^{2}{x}^{2}-{a}^{2} \right ) } \right ) \sqrt{bx+a}\sqrt{-c \left ( bx-a \right ) }{\frac{1}{\sqrt{{\frac{c \left ({a}^{2}{f}^{2}-{b}^{2}{e}^{2} \right ) }{{f}^{2}}}}}}{\frac{1}{\sqrt{{b}^{2}c}}}{\frac{1}{\sqrt{-c \left ({b}^{2}{x}^{2}-{a}^{2} \right ) }}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((C*x^2+B*x+A)/(f*x+e)/(b*x+a)^(1/2)/(-b*c*x+a*c)^(1/2),x)

[Out]

(-A*ln(2*(b^2*c*e*x+a^2*c*f+(c*(a^2*f^2-b^2*e^2)/f^2)^(1/2)*(-c*(b^2*x^2-a^2))^(1/2)*f)/(f*x+e))*b^2*c*f^2*(b^
2*c)^(1/2)+B*ln(2*(b^2*c*e*x+a^2*c*f+(c*(a^2*f^2-b^2*e^2)/f^2)^(1/2)*(-c*(b^2*x^2-a^2))^(1/2)*f)/(f*x+e))*b^2*
c*e*f*(b^2*c)^(1/2)+B*arctan((b^2*c)^(1/2)*x/(-c*(b^2*x^2-a^2))^(1/2))*b^2*c*f^2*(c*(a^2*f^2-b^2*e^2)/f^2)^(1/
2)-C*ln(2*(b^2*c*e*x+a^2*c*f+(c*(a^2*f^2-b^2*e^2)/f^2)^(1/2)*(-c*(b^2*x^2-a^2))^(1/2)*f)/(f*x+e))*b^2*c*e^2*(b
^2*c)^(1/2)-C*arctan((b^2*c)^(1/2)*x/(-c*(b^2*x^2-a^2))^(1/2))*b^2*c*e*f*(c*(a^2*f^2-b^2*e^2)/f^2)^(1/2)-C*f^2
*(b^2*c)^(1/2)*(c*(a^2*f^2-b^2*e^2)/f^2)^(1/2)*(-c*(b^2*x^2-a^2))^(1/2))*(b*x+a)^(1/2)*(-c*(b*x-a))^(1/2)/b^2/
(c*(a^2*f^2-b^2*e^2)/f^2)^(1/2)/(b^2*c)^(1/2)/f^3/c/(-c*(b^2*x^2-a^2))^(1/2)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((C*x^2+B*x+A)/(f*x+e)/(b*x+a)^(1/2)/(-b*c*x+a*c)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((C*x^2+B*x+A)/(f*x+e)/(b*x+a)^(1/2)/(-b*c*x+a*c)^(1/2),x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{A + B x + C x^{2}}{\sqrt{- c \left (- a + b x\right )} \sqrt{a + b x} \left (e + f x\right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((C*x**2+B*x+A)/(f*x+e)/(b*x+a)**(1/2)/(-b*c*x+a*c)**(1/2),x)

[Out]

Integral((A + B*x + C*x**2)/(sqrt(-c*(-a + b*x))*sqrt(a + b*x)*(e + f*x)), x)

________________________________________________________________________________________

Giac [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((C*x^2+B*x+A)/(f*x+e)/(b*x+a)^(1/2)/(-b*c*x+a*c)^(1/2),x, algorithm="giac")

[Out]

Timed out